home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c,comp.std.c
- Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
- Date: Mon, 29 Jan 96 23:55:02 GMT
- Organization: none
- Message-ID: <822959702snz@genesis.demon.co.uk>
- References: <30C40F77.53B5@swsbbs.com> <DLtABq.Fzu@mv.mv.com> <4edqh2$rvl@solutions.solon.com> <KANZE.96Jan29121956@slsvewt.lts.sel.alcatel.de> <4eindq$eju@solutions.solon.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4eindq$eju@solutions.solon.com>
- seebs@solutions.solon.com "Peter Seebach" writes:
-
- >I would tend to expect a diagnostic in strict ANSI mode, and would also
- >expect a diagnostic for including <sys/stat.h> in strict ANSI mode. Neither
- >is often forthcoming.
-
- ANSI doesn't require a diagnostic for either of those so an implementation
- that follows the letter of the standard doesn't have to diagnose either
- of them. Your compiler may have an extra feature (i.e. not required by the
- standard) where it tries to diagnose code that isn't strictly conforming.
- In the general case that's a hopeless task since many forms of system
- dependency are not detectable at compile time but you might expect such a
- compiler to diagnose the cases above. I have yet to come across a compiler
- that attempts to do this however, it probably isn't all that useful
- in practice.
-
- >gcc warns only on implementations where they consider it a hosted environment;
- >on most systems, they weasel and claim to be a freestanding implementation.
-
- Since gcc is a compiler that doesn't come with a library, in itself it
- can't be a hosted implementation. Where it is used with other people's
- libraries calling it a hosted implementation implies taking responsibility
- for those libraries. I certainly wouldn't be keen on doing that!
-
- >>Normally, I would expect (at the very least) a compiler to generate a
- >>warning or an error for a main that it did not support. In fact,
- >>however, my compiler (gcc) accepts the following definition without
- >>the slightest complaint, although I'd rather not think about what will
- >>happen when I access parameter d:
- >
- >> int main( char a , int b , long c , double d )
- >
- >I think that may actually legitimately require a diagnostic; 5.1.2.2.1 gives
- >us a constraint (?) of "If they are defined, the parameters to the main
- >function shall obey the following constraints: ..." and some definitions.
-
- Interesting observation. I expect that the constraints referred to in
- 5.1.1.3 are the constraint sections. This is worth clarifying though.
-
- >I would take this as implying that main *must* conform. I would like to see
- >them go from "can be declared" to "shall be declared".
-
- That makes no difference. Violation of a 'shall' clause results in
- undefined behaviour in the same way as a lack of definition. See 3.16
- (which I just included in a post prior to this). To require a diagnostic
- you would need to create a constraints section.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-